<?php
class Member extends AppModel {
    var $name = 'Member';
    var $validate = array(
        'username' => array(
            'isEmail' => array(
                'rule'     => 'email',
                'required' => true,
                'message'  => 'Please supply a valid email address'
            ),
            'isUnique' => array(
                'rule'    => 'isUnique',
                //'on'      => 'create',
                'message' => 'This email has already existed in database'
            )
        ),
        'password' => array(
            'minlength' => array(
                'rule'    => array('minLength', 6),
                'message' => 'Password must be at least 6 characters long'
            )
        ),
        'name' => array(
            'minlength' => array(
                'rule'    => array('minLength', 3),
                'message' => 'Full Name should at least have 3 characters long'
            )
        ),
        'telephone' => array(
            'minlength' => array(
                'rule'    => array('minLength', 6),
                'message' => 'Invalid Telephone'
            )
        ),
        'address' => array(
            'minlength' => array(
                'rule'    => array('minLength', 6),
                'message' => 'Address should at least have 6 characters long'
            )
        ),
        'postcode' => array(
            'minlength' => array(
                'rule'    => array('minLength', 3),
                'message' => 'Postcode should at least 3 characters long'
            )
        ),
        'city' => array(
            'minlength' => array(
                'rule'    => array('minLength', 6),
                'message' => 'City should at least have 3 characters long'
            )
        ),
        'state' => array(
            'minlength' => array(
                'rule'    => array('minLength', 6),
                'message' => 'State should at least have 3 characters long'
            )
        ),
        'country' => array(
            'minlength' => array(
                'rule'    => array('minLength', 6),
                'message' => 'Country should at least have 3 characters long'
            )
        )
    );
} // Member
?>